util/service: Add the generic loopback transport - #498
Merged
Merged
Conversation
chrysh
force-pushed
the
service-loopback
branch
from
September 25, 2026 13:14
75a3135 to
7e79206
Compare
chrysh
force-pushed
the
service-loopback
branch
from
September 25, 2026 13:33
7e79206 to
842c066
Compare
chrysh
force-pushed
the
service-loopback
branch
3 times, most recently
from
September 26, 2026 13:54
2ad9a81 to
9f13b75
Compare
i2c and pldm each wrote their own loopback, both the same shape around a different dispatch function. Loopback<D, N> is that shape once, over the Dispatch trait: the server implementation that runs behind a kernel channel in production answers in-process here, so a host test exercises the real encode, dispatch and decode paths. Delayed wraps any transport and withholds the response for a set number of polls, which is how a host test reaches a client's not-ready path that a loopback cannot produce. N sizes the response buffer the async path holds between start and poll. The blocking path writes into the caller's buffer and does not use it. Assisted-by: Claude
chrysh
force-pushed
the
service-loopback
branch
from
September 26, 2026 17:36
a75ab43 to
c8e7970
Compare
chrysh
marked this pull request as ready for review
September 26, 2026 17:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
i2c and pldm each wrote their own loopback, both the same shape around a
different dispatch function.
Loopback<D, N>is that shape once, overthe
Dispatchtrait.The server implementation running behind a kernel channel in production
is the one answering here, so a host test exercises the real encode,
dispatch and decode paths instead of a stand-in.
pollnever returnsOk(None)because the response exists the momentthe request does.
Delayed<T>wraps any transport and withholds theresponse for a set number of polls, which is how a host test reaches
a client's not-ready path without a kernel channel.
From<DispatchError> for TransportErrormaps dispatch failures intotransport errors with an exhaustive match, so adding a
DispatchErrorvariant is a compile error rather than a silent mislabel.
Nsizes the response buffer the async path holds betweenstartandpoll. The blocking path writes into the caller's buffer and does notuse it.
Review the last commit only.
Progress toward 9elements#13.